<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include/head::commonHeaderList('老师信息列表')"/>

<body >

<div id="content" class="col-lg-12 col-sm-12">
  <div class="row">
    <div class="box col-md-12" style="padding: 0;margin-top: 5px;">
      <div class="box-inner">
        <div class="box-header well" data-original-title="">
          <h2>
            <i class="glyphicon glyphicon-list"></i>老师信息列表
          </h2>
          <div class="box-icon">
            <a href="javascript:void(0);" id="smaller" class="btn btn-minimize btn-round btn-default"><i class="glyphicon glyphicon-chevron-up"></i></a>
          </div>
        </div>
        <div class="box-content">
          <form class="form-inline form-search " role="form" th:action="@{'/teacher/info/list'}" onsubmit="return checkForm()">
            <div class="form-group" data-chosenWidth="true"  style="margin-bottom: 5px;">
              <select name="pageSize" class="form-control input-md" id="pagesize">
                <option value="15" th:selected="${pageSize==15}">15条/页</option>
                <option value="25" th:selected="${pageSize==25}">25条/页</option>
                <option value="50" th:selected="${pageSize==50}">50条/页</option>
              </select>
              <select id="levelId" class="selectpicker" name="levelId" multiple data-live-search="true" th:title="请选择老师级别" data-live-search-placeholder="搜索">
                <!--<option value="">&#45;&#45;老师级别&#45;&#45;</option>-->
                <option value="1" th:selected="${levelId==null?false:#lists.contains(levelId,1)}">白银老师</option>
                <option value="2" th:selected="${levelId==null?false:#lists.contains(levelId,2)}">铂金老师</option>
                <option value="3" th:selected="${levelId==null?false:#lists.contains(levelId,3)}">钻石老师</option>
                <option value="4" th:selected="${levelId==null?false:#lists.contains(levelId,4)}">青铜老师</option>
                <option value="5" th:selected="${levelId==null?false:#lists.contains(levelId,5)}">欧美老师</option>
                <option value="6" th:selected="${levelId==null?false:#lists.contains(levelId,6)}">中教老师</option>
                <option value="6" th:selected="${levelId==null?false:#lists.contains(levelId,7)}">家长会老师</option>
              </select>
              <select name="testMark" class="form-control input-md" id="testMark">
                <option value="-1" th:selected="${testMark==-1}">不限</option>
                <option value="0" th:selected="${testMark==null || testMark==0}">非测试老师</option>
                <option value="1" th:selected="${testMark==1}">测试老师</option>
              </select>
              <select name="isWork" class="form-control input-md" id="isWork">
                <option value="-1" th:selected="${isWork==-1}">岗位状态</option>
                <option value="1" th:selected="${isWork==null || isWork==1}">在职</option>
                <option value="0" th:selected="${isWork==0}">离职</option>
              </select>
              <select name="breakClass" class="form-control input-md" id="breakClass">
                <option value="-1">课间休息状态</option>
                <option value="0" th:selected="${breakClass==0}">休息</option>
                <option value="1" th:selected="${breakClass==1}">不休息</option>
              </select>
              <select name="state" class="form-control input-md" id="state">
                <option value="-1" th:selected="${state==-1}">账号状态</option>
                <option value="1" th:selected="${state==null || state==1}">正常</option>
                <option value="0" th:selected="${state==0}">已删除</option>
              </select>
              <select name="videoCertMissing" class="form-control input-md" id="videoCertMissing">
                <option value="-1" th:selected="${videoCertMissing==-1}">视频证书状态</option>
                <option value="1" th:selected="${videoCertMissing==1}">无视频</option>
                <option value="2" th:selected="${videoCertMissing==2}">无证书</option>
                <option value="3" th:selected="${videoCertMissing==3}">视频和证书皆无</option>
              </select>
              <div class="input-group">
                <input type="search" name="searchKey" id="search" class="form-control" th:value="${searchKey}" title="可搜索登录名和英文名关键字" placeholder="查询关键字，多关键字空格分割" style="width:250px;"/>
                <span class="input-group-btn"><button class="btn btn-default" type="submit" > 查 询 </button></span>
              </div>
              <button id="add" type="button" th:if="${session.menuMap[54] != null}" th:onclick="openLayerWindows('admin/person_initEdit.action?person.roleId=4')" class="btn btn-primary">
                  <span class="glyphicon glyphicon-plus-sign"></span> 添 加  </button>
            </div>
          </form>
          <table class="table table-striped table-bordered table-hover footable" data-show-toggle="false">
            <thead>
            <tr>
              <th class="text-center">#</th>
              <th class="text-center" style="white-space:nowrap;">登录名</th>
              <th class="text-center" style="white-space:nowrap;">英文名</th>
              <th class="text-center" style="white-space:nowrap;" data-breakpoints="xs sm" data-style="text-align:left;">性别</th>
              <th class="text-center" style="white-space:nowrap;">老师等级</th>
              <th class="text-center" style="white-space:nowrap;" data-breakpoints="all" data-style="text-align:left;">所属基地</th>
              <th class="text-center" style="white-space:nowrap;" data-breakpoints="all"  data-style="text-align:left;">中文程度</th>
              <th class="text-center" style="white-space:nowrap;" data-breakpoints="md xs sm"  data-style="text-align:left;">教龄</th>
              <th class="text-center" style="white-space:nowrap;">课间休息</th>
              <th class="text-center" style="white-space:nowrap;">在职</th>
              <th class="text-center" style="white-space:nowrap;">状态</th>
              <th class="text-center" style="white-space:nowrap;" data-breakpoints="xs sm" data-style="text-align:left;">擅长年龄段</th>
              <th class="text-center" style="white-space:nowrap;" data-breakpoints="xs sm" data-style="text-align:left;">教学风格</th>
              <th class="text-center" style="white-space:nowrap;" data-breakpoints="md xs sm">所属组别</th>
              <th class="text-center" style="white-space:nowrap;">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="item,itemStat:${pageInfo.list}">
              <td class="text-center" style="vertical-align: middle;" th:text="${itemStat.index+1}"></td>
              <td class="text-center" style="white-space:nowrap;vertical-align: middle;">
                <a href="javascript:" th:onclick="|showTeacherInfo(${item.id})|" th:text="${item.loginName}"></a>
              </td>
              <td class="text-center" style="vertical-align: middle;" th:text="${item.enName}"></td>
              <td class="text-center" style="vertical-align: middle;" th:switch="${item.sex}">
                <span th:case="1">男</span>
                <span th:case="2">女</span>
              </td>
              <td class="text-center" style="vertical-align: middle;white-space:nowrap;" th:text="${item.levelCnName}"></td>
              <td class="text-center" style="vertical-align: middle;white-space:nowrap;" th:text="${item.siteName}"></td>
              <td class="text-center" style="vertical-align: middle;" th:switch="${item.chineseLevel}">
                <span th:case="1">不会</span>
                <span th:case="2">简单</span>
                <span th:case="3">一般</span>
                <span th:case="4">良好</span>
              </td>
              <td class="text-center" style="vertical-align: middle;" th:text="${item.teachingAge>0?(item.teachingAge+'年'):''}"></td>
              <td class="text-center" style="vertical-align: middle;" th:switch="${item.breakClass}">
                <label class="label label-danger" th:case="1">不休</label>
                <label class="label label-success" th:case="0">休息</label>
              </td>
              <td class="text-center" style="vertical-align: middle;" th:switch="${item.isWork}">
                <label class="label label-success" th:case="1">在职</label>
                <label class="label label-danger" th:case="0">离职</label>
              </td>
              <td class="text-center" style="vertical-align: middle;" th:switch="${item.state}">
                <label class="label label-success" th:case="1">正常</label>
                <label class="label label-default" th:case="0">已注销</label>
              </td>
              <td >
                <label class="label label-default" style="margin-right:5px;margin-bottom:2px;margin-top:2px;" th:if="${item.ageName!=null && item.ageName!=''}" th:each="name:${#strings.listSplit(item.ageName,',')}" th:text="${name}"></label>
              </td>
              <td>
                <label class="label label-default" style="margin-right:5px;margin-bottom:2px;margin-top:2px;" th:if="${item.styleName!=null && item.styleName!=''}" th:each="name:${#strings.listSplit(item.styleName,',')}" th:text="${name}"></label>
              </td>
              <td>
                <label class="label label-default" style="margin-right:5px;margin-bottom:2px;margin-top:2px;" th:if="${item.groupName!=null && item.groupName!=''}" th:each="name:${#strings.listSplit(item.groupName,',')}" th:text="${name}"></label>
              </td>
              <td>
                <button class="btn btn-success btn-xs" th:if="${session.menuMap[60] != null && item.isWork==1}" th:onclick="openLayerWindows('admin/person_getWeekScheduleInfo.action?flag=0&person.loginName='+[[${item.loginName}]])" id="week"><i class="glyphicon glyphicon-calendar icon-white"></i>周课表</button>

                <button class="btn btn-warning btn-xs" th:if="${session.menuMap[59] != null && item.isWork==1}" th:onclick="openLayerWindows('admin/person_getScheduleInfo.action?person.loginName='+[[${item.loginName}]])" id="scheduling"><i class="glyphicon glyphicon-calendar icon-white"></i>排课表</button>

                <button class="btn btn-info btn-xs" th:if="${session.menuMap[57] != null}" th:onclick="openLayerWindows('admin/person_initEdit.action?person.id='+[[${item.id}]])" id="edit"> <i class="glyphicon glyphicon-edit icon-white"></i> Edit </button>

                <button class="btn btn-success btn-xs" th:if="${session.menuMap[123] != null}" th:onclick="openLayerWindows('admin/person_initTeaIntegral.action?person.id='+[[${item.id}]])" id="score"><i class="glyphicon glyphicon-zoom-in icon-white"></i>RBE</button>

                <!--<button class="btn btn-danger btn-xs" th:if="${session.menuMap[56] != null && (session.roleId==7 || session.roleId==14 || session.roleId==1)}" href="#" rel="popover"  data-placement="left" onclick="popoverHtml(${item.id})">
                      <i class="glyphicon glyphicon-trash icon-white"></i> Delete </button>-->
              </td>
            </tr>
            </tbody>
          </table>
          <div th:include="include/pageinfo::pager"></div>
        </div>
      </div>
    </div>
  </div>
</div>
<div th:include="include/onload_js::onloadJSCustomList(~{::script})">
  <script src="../../static/js/openPerson.js" th:src="@{'/static/js/openPerson.js'}" ></script>
  <script src="../../static/js/layerTeacherInfo.js" th:src="@{/static/js/layerTeacherInfo.js?v=20210414}"></script>
  <script>
    $(function() {
      $('.footable').footable();
    });
    function openLayerWindows(url){
      let surl="//www.etalk365.com/";
      if (url!=null && $.trim(url)!=''){
        surl+=url+'&userToken=[[${session.userToken}]]';
      }
      layer.open({
        type: 2,
        title: false,
        closeBtn: 1, //显示关闭按钮
        shade: [0.5],
        area: ['80%', '90%'],
        //offset: 'rb', //右下角弹出
        // time: 2000, //2秒后自动关闭
        anim: 2,
        content: [surl, 'yes'], //iframe的url，no代表不显示滚动条
      });
    }

    function checkForm() {
      // if ($.trim($("#strClassDate").val())===''){
      //   layer.tips('请选择查询日期','#strClassDate',{tips: [3, '#3595cc']});
      //   return false;
      // }
    }
  </script>

</body>
</html>